Optimal. Leaf size=221 \[ \frac {2 a c (e f+d g)-b (c d f+a e g)-\left (2 c^2 d f+b^2 e g-c (b e f+b d g+2 a e g)\right ) x}{2 c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )^2}+\frac {\left (6 c^2 d f+b^2 e g+c (2 a e g-3 b (e f+d g))\right ) (b+2 c x)}{2 c \left (b^2-4 a c\right )^2 \left (a+b x+c x^2\right )}-\frac {2 \left (6 c^2 d f+b^2 e g+c (2 a e g-3 b (e f+d g))\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{5/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 219, normalized size of antiderivative = 0.99, number of steps
used = 4, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {791, 628, 632,
212} \begin {gather*} \frac {(b+2 c x) \left (2 a c e g+b^2 e g-3 b c (d g+e f)+6 c^2 d f\right )}{2 c \left (b^2-4 a c\right )^2 \left (a+b x+c x^2\right )}+\frac {-x \left (-c (2 a e g+b d g+b e f)+b^2 e g+2 c^2 d f\right )-b (a e g+c d f)+2 a c (d g+e f)}{2 c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )^2}-\frac {2 \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (2 a c e g+b^2 e g-3 b c (d g+e f)+6 c^2 d f\right )}{\left (b^2-4 a c\right )^{5/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 628
Rule 632
Rule 791
Rubi steps
\begin {align*} \int \frac {(d+e x) (f+g x)}{\left (a+b x+c x^2\right )^3} \, dx &=\frac {2 a c (e f+d g)-b (c d f+a e g)-\left (2 c^2 d f+b^2 e g-c (b e f+b d g+2 a e g)\right ) x}{2 c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )^2}-\frac {\left (6 c^2 d f+b^2 e g+2 a c e g-3 b c (e f+d g)\right ) \int \frac {1}{\left (a+b x+c x^2\right )^2} \, dx}{2 c \left (b^2-4 a c\right )}\\ &=\frac {2 a c (e f+d g)-b (c d f+a e g)-\left (2 c^2 d f+b^2 e g-c (b e f+b d g+2 a e g)\right ) x}{2 c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )^2}+\frac {\left (6 c^2 d f+b^2 e g+2 a c e g-3 b c (e f+d g)\right ) (b+2 c x)}{2 c \left (b^2-4 a c\right )^2 \left (a+b x+c x^2\right )}+\frac {\left (6 c^2 d f+b^2 e g+2 a c e g-3 b c (e f+d g)\right ) \int \frac {1}{a+b x+c x^2} \, dx}{\left (b^2-4 a c\right )^2}\\ &=\frac {2 a c (e f+d g)-b (c d f+a e g)-\left (2 c^2 d f+b^2 e g-c (b e f+b d g+2 a e g)\right ) x}{2 c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )^2}+\frac {\left (6 c^2 d f+b^2 e g+2 a c e g-3 b c (e f+d g)\right ) (b+2 c x)}{2 c \left (b^2-4 a c\right )^2 \left (a+b x+c x^2\right )}-\frac {\left (2 \left (6 c^2 d f+b^2 e g+2 a c e g-3 b c (e f+d g)\right )\right ) \text {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{\left (b^2-4 a c\right )^2}\\ &=\frac {2 a c (e f+d g)-b (c d f+a e g)-\left (2 c^2 d f+b^2 e g-c (b e f+b d g+2 a e g)\right ) x}{2 c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )^2}+\frac {\left (6 c^2 d f+b^2 e g+2 a c e g-3 b c (e f+d g)\right ) (b+2 c x)}{2 c \left (b^2-4 a c\right )^2 \left (a+b x+c x^2\right )}-\frac {2 \left (6 c^2 d f+b^2 e g+2 a c e g-3 b c (e f+d g)\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{5/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.27, size = 216, normalized size = 0.98 \begin {gather*} \frac {1}{2} \left (\frac {\left (6 c^2 d f+b^2 e g+2 a c e g-3 b c (e f+d g)\right ) (b+2 c x)}{c \left (b^2-4 a c\right )^2 (a+x (b+c x))}+\frac {a b e g+2 c^2 d f x+b^2 e g x+b c (-e f x+d (f-g x))-2 a c (d g+e (f+g x))}{c \left (-b^2+4 a c\right ) (a+x (b+c x))^2}+\frac {4 \left (6 c^2 d f+b^2 e g+2 a c e g-3 b c (e f+d g)\right ) \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\left (-b^2+4 a c\right )^{5/2}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 381, normalized size = 1.72
method | result | size |
default | \(\frac {\frac {c \left (2 a c e g +b^{2} e g -3 b c d g -3 b c e f +6 c^{2} d f \right ) x^{3}}{16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}}+\frac {3 b \left (2 a c e g +b^{2} e g -3 b c d g -3 b c e f +6 c^{2} d f \right ) x^{2}}{2 \left (16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}\right )}-\frac {\left (2 a^{2} c e g -5 a \,b^{2} e g +5 a b c d g +5 a b c e f -10 a \,c^{2} d f +b^{3} d g +b^{3} e f -2 b^{2} c d f \right ) x}{16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}}+\frac {6 a^{2} b e g -8 a^{2} c d g -8 a^{2} c e f -a \,b^{2} d g -a \,b^{2} e f +10 a b c d f -b^{3} d f}{32 a^{2} c^{2}-16 a \,b^{2} c +2 b^{4}}}{\left (c \,x^{2}+b x +a \right )^{2}}+\frac {2 \left (2 a c e g +b^{2} e g -3 b c d g -3 b c e f +6 c^{2} d f \right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}\right ) \sqrt {4 a c -b^{2}}}\) | \(381\) |
risch | \(\frac {\frac {c \left (2 a c e g +b^{2} e g -3 b c d g -3 b c e f +6 c^{2} d f \right ) x^{3}}{16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}}+\frac {3 b \left (2 a c e g +b^{2} e g -3 b c d g -3 b c e f +6 c^{2} d f \right ) x^{2}}{2 \left (16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}\right )}-\frac {\left (2 a^{2} c e g -5 a \,b^{2} e g +5 a b c d g +5 a b c e f -10 a \,c^{2} d f +b^{3} d g +b^{3} e f -2 b^{2} c d f \right ) x}{16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}}+\frac {6 a^{2} b e g -8 a^{2} c d g -8 a^{2} c e f -a \,b^{2} d g -a \,b^{2} e f +10 a b c d f -b^{3} d f}{32 a^{2} c^{2}-16 a \,b^{2} c +2 b^{4}}}{\left (c \,x^{2}+b x +a \right )^{2}}-\frac {2 \ln \left (\left (32 a^{2} c^{3}-16 a \,b^{2} c^{2}+2 b^{4} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {5}{2}}+16 a^{2} b \,c^{2}-8 a \,b^{3} c +b^{5}\right ) a c e g}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}}}-\frac {\ln \left (\left (32 a^{2} c^{3}-16 a \,b^{2} c^{2}+2 b^{4} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {5}{2}}+16 a^{2} b \,c^{2}-8 a \,b^{3} c +b^{5}\right ) b^{2} e g}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}}}+\frac {3 \ln \left (\left (32 a^{2} c^{3}-16 a \,b^{2} c^{2}+2 b^{4} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {5}{2}}+16 a^{2} b \,c^{2}-8 a \,b^{3} c +b^{5}\right ) b c d g}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}}}+\frac {3 \ln \left (\left (32 a^{2} c^{3}-16 a \,b^{2} c^{2}+2 b^{4} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {5}{2}}+16 a^{2} b \,c^{2}-8 a \,b^{3} c +b^{5}\right ) b c e f}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}}}-\frac {6 \ln \left (\left (32 a^{2} c^{3}-16 a \,b^{2} c^{2}+2 b^{4} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {5}{2}}+16 a^{2} b \,c^{2}-8 a \,b^{3} c +b^{5}\right ) c^{2} d f}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}}}+\frac {2 \ln \left (\left (-32 a^{2} c^{3}+16 a \,b^{2} c^{2}-2 b^{4} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {5}{2}}-16 a^{2} b \,c^{2}+8 a \,b^{3} c -b^{5}\right ) a c e g}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}}}+\frac {\ln \left (\left (-32 a^{2} c^{3}+16 a \,b^{2} c^{2}-2 b^{4} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {5}{2}}-16 a^{2} b \,c^{2}+8 a \,b^{3} c -b^{5}\right ) b^{2} e g}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}}}-\frac {3 \ln \left (\left (-32 a^{2} c^{3}+16 a \,b^{2} c^{2}-2 b^{4} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {5}{2}}-16 a^{2} b \,c^{2}+8 a \,b^{3} c -b^{5}\right ) b c d g}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}}}-\frac {3 \ln \left (\left (-32 a^{2} c^{3}+16 a \,b^{2} c^{2}-2 b^{4} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {5}{2}}-16 a^{2} b \,c^{2}+8 a \,b^{3} c -b^{5}\right ) b c e f}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}}}+\frac {6 \ln \left (\left (-32 a^{2} c^{3}+16 a \,b^{2} c^{2}-2 b^{4} c \right ) x +\left (-4 a c +b^{2}\right )^{\frac {5}{2}}-16 a^{2} b \,c^{2}+8 a \,b^{3} c -b^{5}\right ) c^{2} d f}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}}}\) | \(1037\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 926 vs.
\(2 (224) = 448\).
time = 3.85, size = 1873, normalized size = 8.48 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 1234 vs.
\(2 (218) = 436\).
time = 7.42, size = 1234, normalized size = 5.58 \begin {gather*} - \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \cdot \left (2 a c e g + b^{2} e g - 3 b c d g - 3 b c e f + 6 c^{2} d f\right ) \log {\left (x + \frac {- 64 a^{3} c^{3} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \cdot \left (2 a c e g + b^{2} e g - 3 b c d g - 3 b c e f + 6 c^{2} d f\right ) + 48 a^{2} b^{2} c^{2} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \cdot \left (2 a c e g + b^{2} e g - 3 b c d g - 3 b c e f + 6 c^{2} d f\right ) - 12 a b^{4} c \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \cdot \left (2 a c e g + b^{2} e g - 3 b c d g - 3 b c e f + 6 c^{2} d f\right ) + 2 a b c e g + b^{6} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \cdot \left (2 a c e g + b^{2} e g - 3 b c d g - 3 b c e f + 6 c^{2} d f\right ) + b^{3} e g - 3 b^{2} c d g - 3 b^{2} c e f + 6 b c^{2} d f}{4 a c^{2} e g + 2 b^{2} c e g - 6 b c^{2} d g - 6 b c^{2} e f + 12 c^{3} d f} \right )} + \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \cdot \left (2 a c e g + b^{2} e g - 3 b c d g - 3 b c e f + 6 c^{2} d f\right ) \log {\left (x + \frac {64 a^{3} c^{3} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \cdot \left (2 a c e g + b^{2} e g - 3 b c d g - 3 b c e f + 6 c^{2} d f\right ) - 48 a^{2} b^{2} c^{2} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \cdot \left (2 a c e g + b^{2} e g - 3 b c d g - 3 b c e f + 6 c^{2} d f\right ) + 12 a b^{4} c \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \cdot \left (2 a c e g + b^{2} e g - 3 b c d g - 3 b c e f + 6 c^{2} d f\right ) + 2 a b c e g - b^{6} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \cdot \left (2 a c e g + b^{2} e g - 3 b c d g - 3 b c e f + 6 c^{2} d f\right ) + b^{3} e g - 3 b^{2} c d g - 3 b^{2} c e f + 6 b c^{2} d f}{4 a c^{2} e g + 2 b^{2} c e g - 6 b c^{2} d g - 6 b c^{2} e f + 12 c^{3} d f} \right )} + \frac {6 a^{2} b e g - 8 a^{2} c d g - 8 a^{2} c e f - a b^{2} d g - a b^{2} e f + 10 a b c d f - b^{3} d f + x^{3} \cdot \left (4 a c^{2} e g + 2 b^{2} c e g - 6 b c^{2} d g - 6 b c^{2} e f + 12 c^{3} d f\right ) + x^{2} \cdot \left (6 a b c e g + 3 b^{3} e g - 9 b^{2} c d g - 9 b^{2} c e f + 18 b c^{2} d f\right ) + x \left (- 4 a^{2} c e g + 10 a b^{2} e g - 10 a b c d g - 10 a b c e f + 20 a c^{2} d f - 2 b^{3} d g - 2 b^{3} e f + 4 b^{2} c d f\right )}{32 a^{4} c^{2} - 16 a^{3} b^{2} c + 2 a^{2} b^{4} + x^{4} \cdot \left (32 a^{2} c^{4} - 16 a b^{2} c^{3} + 2 b^{4} c^{2}\right ) + x^{3} \cdot \left (64 a^{2} b c^{3} - 32 a b^{3} c^{2} + 4 b^{5} c\right ) + x^{2} \cdot \left (64 a^{3} c^{3} - 12 a b^{4} c + 2 b^{6}\right ) + x \left (64 a^{3} b c^{2} - 32 a^{2} b^{3} c + 4 a b^{5}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.38, size = 369, normalized size = 1.67 \begin {gather*} \frac {2 \, {\left (6 \, c^{2} d f - 3 \, b c d g - 3 \, b c f e + b^{2} g e + 2 \, a c g e\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{{\left (b^{4} - 8 \, a b^{2} c + 16 \, a^{2} c^{2}\right )} \sqrt {-b^{2} + 4 \, a c}} + \frac {12 \, c^{3} d f x^{3} - 6 \, b c^{2} d g x^{3} - 6 \, b c^{2} f x^{3} e + 2 \, b^{2} c g x^{3} e + 4 \, a c^{2} g x^{3} e + 18 \, b c^{2} d f x^{2} - 9 \, b^{2} c d g x^{2} - 9 \, b^{2} c f x^{2} e + 3 \, b^{3} g x^{2} e + 6 \, a b c g x^{2} e + 4 \, b^{2} c d f x + 20 \, a c^{2} d f x - 2 \, b^{3} d g x - 10 \, a b c d g x - 2 \, b^{3} f x e - 10 \, a b c f x e + 10 \, a b^{2} g x e - 4 \, a^{2} c g x e - b^{3} d f + 10 \, a b c d f - a b^{2} d g - 8 \, a^{2} c d g - a b^{2} f e - 8 \, a^{2} c f e + 6 \, a^{2} b g e}{2 \, {\left (b^{4} - 8 \, a b^{2} c + 16 \, a^{2} c^{2}\right )} {\left (c x^{2} + b x + a\right )}^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.59, size = 555, normalized size = 2.51 \begin {gather*} \frac {2\,\mathrm {atan}\left (\frac {\left (\frac {2\,c\,x\,\left (6\,c^2\,d\,f+b^2\,e\,g+2\,a\,c\,e\,g-3\,b\,c\,d\,g-3\,b\,c\,e\,f\right )}{{\left (4\,a\,c-b^2\right )}^{5/2}}+\frac {\left (16\,a^2\,b\,c^2-8\,a\,b^3\,c+b^5\right )\,\left (6\,c^2\,d\,f+b^2\,e\,g+2\,a\,c\,e\,g-3\,b\,c\,d\,g-3\,b\,c\,e\,f\right )}{{\left (4\,a\,c-b^2\right )}^{5/2}\,\left (16\,a^2\,c^2-8\,a\,b^2\,c+b^4\right )}\right )\,\left (16\,a^2\,c^2-8\,a\,b^2\,c+b^4\right )}{6\,c^2\,d\,f+b^2\,e\,g+2\,a\,c\,e\,g-3\,b\,c\,d\,g-3\,b\,c\,e\,f}\right )\,\left (6\,c^2\,d\,f+b^2\,e\,g+2\,a\,c\,e\,g-3\,b\,c\,d\,g-3\,b\,c\,e\,f\right )}{{\left (4\,a\,c-b^2\right )}^{5/2}}-\frac {\frac {b^3\,d\,f+a\,b^2\,d\,g+a\,b^2\,e\,f-6\,a^2\,b\,e\,g+8\,a^2\,c\,d\,g+8\,a^2\,c\,e\,f-10\,a\,b\,c\,d\,f}{2\,\left (16\,a^2\,c^2-8\,a\,b^2\,c+b^4\right )}+\frac {x\,\left (b^3\,d\,g+b^3\,e\,f-10\,a\,c^2\,d\,f-5\,a\,b^2\,e\,g-2\,b^2\,c\,d\,f+2\,a^2\,c\,e\,g+5\,a\,b\,c\,d\,g+5\,a\,b\,c\,e\,f\right )}{16\,a^2\,c^2-8\,a\,b^2\,c+b^4}-\frac {3\,b\,x^2\,\left (6\,c^2\,d\,f+b^2\,e\,g+2\,a\,c\,e\,g-3\,b\,c\,d\,g-3\,b\,c\,e\,f\right )}{2\,\left (16\,a^2\,c^2-8\,a\,b^2\,c+b^4\right )}-\frac {c\,x^3\,\left (6\,c^2\,d\,f+b^2\,e\,g+2\,a\,c\,e\,g-3\,b\,c\,d\,g-3\,b\,c\,e\,f\right )}{16\,a^2\,c^2-8\,a\,b^2\,c+b^4}}{x^2\,\left (b^2+2\,a\,c\right )+a^2+c^2\,x^4+2\,a\,b\,x+2\,b\,c\,x^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________